package com.lvan.bean;

import java.io.Serializable;

public class Entity implements Serializable{

	private static final long serialVersionUID = -2710157535045293435L;
	private boolean fk;
	private String fuzzy = null;
	private String orderBy;
	private String orderType = "desc";
	public boolean isFk() {
		return fk;
	}
	public void setFk(boolean fk) {
		this.fk = fk;
	}
	public String getFuzzy() {
		return fuzzy;
	}
	public void setFuzzy(String fuzzy) {
		this.fuzzy = fuzzy;
	}
	public String getOrderBy() {
		return orderBy;
	}
	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}
	public String getOrderType() {
		return orderType;
	}
	public void setOrderType(String orderType) {
		this.orderType = orderType;
	}
	public String convertField2Column() {
		if(this.orderBy!=null) {
			StringBuilder temp = new StringBuilder("");
			char[] s = orderBy.toCharArray();
			for(char t : s) {
				int k = (int)t;
				if(k>=97&&k<=122) {
					temp.append(t);
				}else {
					temp.append("_"+t);
				}
			}
			return temp.toString();
		}
		return null;
	}
}
